import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:incidentmanager/blocs/case/form/case_form_bloc.dart';
import 'package:incidentmanager/common/data/repositories/case_repository.dart';
import 'package:incidentmanager/common/resource/colors.dart';
import 'package:incidentmanager/common/resource/styles.dart';
import 'package:incidentmanager/widgets/custom_stepper.dart';

part 'case_base_info.dart';
part 'case_other_info.dart';
part 'case_complete_info.dart';

class CaseStepper extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (context) => CaseFormBloc(
        caseRepository: CaseRepository(),
      ),
      child: SafeArea(
        child: CustomStepper(
          currentStep: 0,
          onStepCancel: () {},
          onStepContinue: () {},
          onStepTapped: (index) {
            print(index);
          },
          steps: <Step>[
            Step(
              title: Text('基本信息'),
              content: _BaseInfo(),
              isActive: true,
            ),
            Step(
              title: Text('其它信息'),
              content: _OtherInfo(),
            ),
            Step(
              title: Text('完成上报'),
              content: _CompleteInfo(),
            ),
          ],
          type: StepperType.horizontal,
          controlsBuilder: (BuildContext context,
              {VoidCallback onStepContinue, VoidCallback onStepCancel}) {
            return Container();
          },
        ),
      ),
    );
  }
}
